package com.srd.phone.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;

import com.shengrongdai.srd.R;
import com.srd.phone.activity.ObligationsDetailsActivity;
import com.srd.phone.adapter.TransferManageAdapter;

/**
 * 债权管理 Fragement
 */
public class ObligationsFragment extends BaseFragment{

    private View viewRoot;
    private ListView mListView = null;
    private TransferManageAdapter adapter = null;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (viewRoot == null)
            viewRoot = inflater.inflate(R.layout.fragment_transfer, container, false);

        initView();
        return viewRoot;
    }

    public void initView() {

        mListView = (ListView)viewRoot.findViewById(R.id.listview);
        adapter = new TransferManageAdapter(getActivity());
        mListView.setAdapter(adapter);

        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                startActivity(new Intent(getActivity(), ObligationsDetailsActivity.class));
            }
        });
    }

}
